{include file="Index/header" /}

<link href="__PUBLIC__/js/froala/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/js/froala/css/froala_editor.min.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/js/froala/js/froala.jquery.js"></script>
<script src="__PUBLIC__/js/froala/js/froala_editor.min.js"></script>
 
    <form action="{:url('Goods/add')}" method="post" /> 
	    <input type="hidden" name="sbt" value="1">
	    <input type="hidden" name="gid" value="{$gid}">
    	<div class="formbody">
    		<div class="formtitle"><span>商品添加</span></div>
		    <ul class="forminfo">
		     	<li>
			    	<label>商品名称</label>
			    	<input name="title" type="text" class="dfinput" value="{$goodsInfo.title}" size="80"/>
			    </li> 
		     	 <li>
			    	<label>商品图片</label>
			    	<div style="float:left;margin-bottom:10px;">
			    	  <input name="pic" id="img1" type="text" readonly class="dfinput" value="{$goodsInfo.pic}" size="80"/>
			    	  
			    	 </div>
			    	<label class="config-upload">
								上传<input style="width:0px;" accept="image/*" name="img" id="uploadFile1" onchange="uploadImg(1);" type="file">
					</label>
					<div class="config-upload">
						<a href="javascript:void(0);" onclick="showPic(1);">预览</a>
					</div>
			    </li>
			    
			   
			    <li>
			    	<label>商品分类</label>
			    	<select name="category_id" class="form-select">
						{volist name="catagoryArr" id="vo" key="k" } 
						<option {if $key==$goodsInfo[category_id]} selected {/if} value="{$key}">{$vo}</option>
						{/volist}
					 
					</select>
			    </li> 
			   
			    <li>
		    	 	<label>售前价格</label>
			    	<input name="presale_price" type="text" style="color:red;" class="dfinput" value="{$goodsInfo.presale_price}" /> (元)
			    </li>
			  
			    <li>
		    	 	<label>规格</label>
			    	<input name="standard" type="text" class="dfinput" value="{$goodsInfo.standard}" size="80"/>
			    </li>
			  	
		    	<li>
		    	 	<label>商品款识</label>
			    	<input name="code" type="text" class="dfinput" value="{$goodsInfo.code}" size="80"/>
			    </li>
			     <li>
		    	 	<label>点击量</label>
			    	<input name="click_num" type="text" class="dfinput" value="{$goodsInfo.click_num}" /> (次)
			    </li>
			    
			    <li>
		    	 	<label>是否热门</label>
			    	<label><input type="radio" name="is_hot" {if $goodsInfo['is_hot']=="1"||!$goodsInfo['is_hot']} checked {/if} value="1"><font color="red" style="font-weight:bold;">是</font></label>
			    	<label><input type="radio" name="is_hot" {if $goodsInfo['is_hot']=="2"} checked {/if} value="2"><font color="grey" style="font-weight:bold;">否</font></label>
			    </li>
			    <li>
		    	 	<label>当前状态</label>
			    	<label><input type="radio" class="status" name="status" {if $goodsInfo['status']=="1"||!$goodsInfo['status']} checked{/if} value="1"><font color="grey" style="font-weight:bold;">待售</font></label>
			    	<label><input type="radio" class="status" name="status" {if $goodsInfo['status']=="2"} checked {/if}  value="2" ><font color="green" style="font-weight:bold;">已成交</font></label>
			    </li>
			   
			    <li id="overCash" {if $goodsInfo['status']=="1"||!$goodsInfo['status']}style="display:none;" {/if} >
		    	 	<label>成交价</label>
			    	<input name="actual_price" type="text" style="color:red;" class="dfinput" value="{$goodsInfo.actual_price}" /> (元)
			    </li>
			    
			    
			    <li>
			    	<label>详细内容</label>
			    	
				  	<div   class="admin-textarea">
				         <textarea id='edit' name="about_content">{$goodsInfo.about_content}</textarea>
					 </div>
			    </li>
			     
			    
			    <li>
			    	<label>&nbsp;</label>
			   		 <input name="submit" type="submit" class="btn" value="确认保存"/>
			   	</li>
		    </ul>
    	</div>
	</form>
<script>

//成交价显示隐藏
$(".status").click(function (){
	 
	if($(this).val()=="1"){ 
		$("#overCash").hide();
	}else{
		$("#overCash").show();
		
	}
	
});

//多文本编辑器
$(function(){
    $('#edit').editable({inlineMode: false, alwaysBlank: true,width:'900px',height:'300px'});
});

//图片上传回调
function uploadCall(obj,path){
	 $("#img"+obj).val(path);
}
//预览
function showPic(obj){
	art.dialog.open($("#showPic").val()+'?pic='+$("#img"+obj).val(),{title:'图片预览'});
}

</script>

{include file="Index/footer" /}